﻿@model MvcForum.Web.Areas.Admin.ViewModels.ListLogViewModel
@{
    ViewBag.Title = "Log";
}

<div class="panel">
    <div class="panel-heading">
        <h5>@ViewBag.Title</h5>
        <div class="tools">
            <a href="@Url.Action("ClearLog")" class="btn-mvc-green">Clear Log</a>
        </div>
    </div>
    <div class="panel-content">
        <p>This is a limited view of the log, if you need to see even more logs then you you'll need to open the logfile.txt in the App_Data folder</p>

        @if (Model.LogFiles.Any())
        {
            <div class="tablescroll">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>
                                Entry Date
                            </th>
                            <th>
                                Module
                            </th>
                            <th>
                                Method
                            </th>
                            <th>
                                DeclaringType
                            </th>
                            <th>
                                LineNumber
                            </th>
                            <th>
                                Message
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var log in Model.LogFiles)
                        {
                            <tr>
                                <td class="logentrydate">
                                    @log.Date
                                </td>
                                <td class="logentrymodule">
                                    @log.Module
                                </td>
                                <td class="logentrymethod">
                                    @log.Method
                                </td>
                                <td class="logentrydeclaringtype">
                                    @log.DeclaringType
                                </td>
                                <td class="logentrylinenumber">
                                    @log.LineNumber
                                </td>
                                <td class="logentrymessage">
                                    @log.ErrorMessage
                                </td>

                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        }

    </div>
</div>


